<template>
	<zkView ref="zkView" v-slot:uContainer>
		<view class="container">
			<view class="userInfo" @click="toProfile">
				<view class="avatar">
					<image mode="aspectFill" :src="userInfo.avatarUrl||'/static/mine/avatar.png'"></image>
				</view>
				<view class="midd">
					<text class="userName">{{ userInfo.nickname || '昵称' }}</text>
					<text v-if="userInfo.role===9" class="userLabel labelBg">店 长</text>
					<text v-else-if="userInfo.role===2" class="userLabel labelBg">尊贵会员</text>
					<text v-else class="userLabel">普通用户</text>
				</view>
				<view class="right" @click.stop="toMessages">
					<uni-icons type="notification" size="30"></uni-icons>
				</view>
			</view>
			<view class="vip" v-if="userInfo.role!==9">
				<view class="vipTxt">
					<text>{{['开通会员·享折扣优惠等6项特权','正享折扣优惠等6项特权'][userInfo.role-1]}}</text>
				</view>
				<view class="vipBtn" @click="toVip()">
					<text>查看详情</text>
				</view>
			</view>
			<view class="content">
				<view class="countBox">
					<view class="countItem" @click="toCouponList('zhe')">
						<text>{{zheCount}}</text>
						<text>优惠券(张)</text>
					</view>
					<view class="countItem" @click="toCouponList('man')">
						<text>{{manCount}}</text>
						<text>包邮券(张)</text>
					</view>
					<view class="countItem" @click="toCreditList()">
						<text>{{creditsTotal}}</text>
						<text>积分</text>
					</view>
				</view>
				<view class="orderBox">
					<view class="title">
						<text>我的订单</text>
						<view class="allArrow" @click="toOrders('0')">
							<text>全部订单</text><uni-icons type="right" size="28rpx"></uni-icons>
						</view>
					</view>
					<view class="itemView">
						<view class="item" @click="toOrders('1')">
							<uni-icons type="wallet-filled" size="60rpx"></uni-icons>
							<text>待付款</text>
							<view class="dot" v-if="userInfo.role===1&&dotNum>0" />
						</view>
						<view class="item" @click="toOrders('2')">
							<uni-icons type="gift-filled" size="60rpx"></uni-icons>
							<text>待发货</text>
						</view>
						<view class="item" @click="toOrders('3')">
							<uni-icons type="paperplane-filled" size="60rpx"></uni-icons>
							<text>待收货</text>
						</view>
					</view>
				</view>
				<view class="adminBox" v-if="userInfo.role===9">
					<view class="title">
						<text>我是店长</text>
						<view class="allArrow" @click="toManager()">
							<text>管理</text><uni-icons type="right" size="28rpx"></uni-icons>
						</view>
					</view>
					<view class="itemView">
						<view class="item">
							<text>￥{{formatPrice(managerData.todaySalesMoney)}}</text>
							<text>今日营业额</text>
						</view>
						<view class="item">
							<text>{{managerData.todaySalesNum||0}}</text>
							<text>今日成交量(单)</text>
						</view>
						<view class="item">
							<text>{{managerData.refundNum||0}}</text>
							<text>今日退款单量</text>
						</view>
						<view class="item">
							<text>{{managerData.totalProNum||0}}</text>
							<text>在售商品(个)</text>
						</view>
						<view class="item">
							<text>{{managerData.shippingNum||0}}</text>
							<text>发货待处理</text>
							<view class="shipping" v-if="managerData.shippingNum>0" @click="toShipping">
								<text>去发货</text>
							</view>
						</view>
						<view class="item">
							<text>{{managerData.onTheWayNum||0}}</text>
							<text>在途单量</text>
						</view>
					</view>
				</view>
				<view class="otherBox">
					<view class="title">
						<text>其它服务</text>
					</view>
					<view class="itemView">
						<view class="item" @click="toVip()">
							<uni-icons type="vip" size="60rpx"></uni-icons>
							<text>会员中心</text>
						</view>
						<view class="item" @click="toCreditShop()">
							<uni-icons type="hand-up" size="60rpx"></uni-icons>
							<text>积分好礼</text>
						</view>
						<view class="item" @click="toExplain()">
							<uni-icons type="help" size="60rpx"></uni-icons>
							<text>常见问题</text>
						</view>
						<view class="item" @click="toFeedback()">
							<uni-icons type="email" size="60rpx"></uni-icons>
							<text>意见反馈</text>
						</view>
						<view class="item" @click="toAbout()">
							<uni-icons type="star" size="60rpx"></uni-icons>
							<text>关于我们</text>
						</view>
						<button class="item" open-type="contact" bindcontact="handleContact" session-from="sessionFrom"
							show-message-card="true">
							<uni-icons type="chatbubble" size="60rpx"></uni-icons><text>在线客服</text>
						</button>
						<button class="item" open-type="share">
							<uni-icons type="redo" size="60rpx"></uni-icons>
							<text>分享小程序</text>
						</button>
						<view class="item" @click="toSetting()">
							<uni-icons type="gear" size="60rpx"></uni-icons>
							<text>设置</text>
						</view>
					</view>
				</view>
				<view class="noMore">
					<text>让家乡的味道飘向世界~</text>
				</view>
			</view>
		</view>
	</zkView>
	<zkTabbar pageIndex="2" />
</template>
<script>
	import indexJs from './index.js';
	import mixins from '@/common/mixins.js';
	export default {
		components: {},
		mixins: [mixins],
		...indexJs
	};
</script>

<style lang="scss" scoped>
	@import './index.scss';
</style>